﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Marmat.Common.Http
{
    public class MethodExecutionArgs : System.ComponentModel.CancelEventArgs
    {
        internal MethodExecutionArgs(object instance, MethodBase method, object[] arguments) : this(instance, method, arguments, null)
        {
        }

        internal MethodExecutionArgs(object instance, MethodBase method, object[] arguments, object returnValue)
        {
            this.Instance = instance;
            this.Method = method;
            this.Arguments = arguments;
            this.ReturnValue = returnValue;
        }

        /// <summary>
        /// 对象实例。
        /// </summary>
        public object Instance { get; }

        /// <summary>
        /// 当前执行的方法。
        /// </summary>
        public MethodBase Method { get; }

        /// <summary>
        /// 当前执行方法的参数。
        /// </summary>
        public object[] Arguments { get; }

        /// <summary>
        /// 
        /// </summary>
        public object ReturnValue { get; set; }
    }
}
